package br.com.linkers.testes;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.junit.Test;

import br.com.linkers.data.HibernateUtil;
import br.com.linkers.entity.Paises;

public class PaisesTest {

	@Test
	public void test() {
		SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
		Session session = sessionFactory.openSession();
		
		Transaction transaction = session.beginTransaction();
		
		Paises pais = new Paises();
		
		pais.setNome("Brasil");
		pais.setAbreviado("BR");
		session.save(pais);

		
		pais.setNome("Estados Unidos");
		pais.setAbreviado("USA");
		session.save(pais);
		
		transaction.commit();
		session.close();

	}
}